MessageManager = null;


_MessageManager = function() { 
	this.UserId = null;
}
_MessageManager.prototype = {
	GetMessagesByUserId: function(userId){
		this.UserId = userId;
		var _GetMessagesByUserId = ClientCommandsManager.Get("GetMessagesByUserId");
		_GetMessagesByUserId.UserId = userId;
        ClientCommandsManager.Execute(_GetMessagesByUserId, this.SuccessHandler, this.ErrorHandler, true);
	},
    AddMessage: function(message){
    	var _AddMessage = ClientCommandsManager.Get("AddMessage");
    	_AddMessage.Message = message;
    	ClientCommandsManager.Execute(_AddMessage, this.SuccessHandler, this.ErrorHandler, true);
    },
    SuccessHandler: function(data, status, request) {
    	$(".NotificationContainer").html("");
        if (data && data != "") {
        	$(".NotificationContainer").html(data.Mesasges);
        }
        //_NotificationManager.prototype.Listen();
    },
    ErrorHandler: function(request, status, errortrow) {
        alert('ERROR ' + errortrow);
    }
}
